package com.aaa.operations.service.impl;

import com.aaa.common.entity.Room;
import com.aaa.operations.dao.RoomDao;
import com.aaa.operations.service.RoomService;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  寝室管理类
 * </p>
 *
 * @author ${author}
 * @since 2020-07-29
 */
@Service
@Transactional
public class RoomServiceImpl extends ServiceImpl<RoomDao, Room> implements RoomService {
    @Autowired
    private RoomDao roomDao;

    public  PageInfo getAllRoom(Integer pageSize, Integer pageNum, Map map){

        PageHelper.startPage(pageNum,pageSize);
        List<HashMap> list = roomDao.getAllRoom(map);
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }

    @Override
    public List<Room> getAllStorey() {
        return roomDao.getAllStorey();
    }

    @Override
    public List<Room> getAllNo(Integer roomStorey) {
        return roomDao.getAllNo(roomStorey);
    }


}
